package com.anyisn.puremvc.as3.multicore.utilities.pipes.component
{
	import mx.modules.ModuleBase;
	
	import org.puremvc.as3.multicore.interfaces.IFacade;
	import org.puremvc.as3.multicore.utilities.pipes.interfaces.IPipeAware;
	import org.puremvc.as3.multicore.utilities.pipes.interfaces.IPipeFitting;
	import org.puremvc.as3.multicore.utilities.pipes.plumbing.JunctionMediator;
	
	public class PipeAwareModule extends ModuleBase implements IPipeAware
	{
		public static const MODULE_TO_APP_PIPE:String = "module2app";
		public static const APP_TO_MODULE_PIPE:String  ="app2module";
		
		protected var facade:IFacade;
		
		public function PipeAwareModule(facade:IFacade)
		{
			super();
			this.facade = facade;
		}
		
		public function acceptInputPipe(name:String, pipe:IPipeFitting):void
		{
			facade.sendNotification(JunctionMediator.ACCEPT_INPUT_PIPE, pipe, name);
		}
		
		public function acceptOutputPipe(name:String, pipe:IPipeFitting):void
		{
			facade.sendNotification(JunctionMediator.ACCEPT_OUTPUT_PIPE, pipe, name);
		}
	}
}